package com.gyg.controller;


import com.gyg.returns.RespEntity;
import com.gyg.returns.RespTable;
import com.gyg.service.CloudAudioService;
import com.gyg.vo.param.BanParam;
import com.gyg.vo.param.FileParam;
import com.gyg.vo.result.AudioResult;
import com.gyg.vo.result.DocumentResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 音频信息表 前端控制器
 * </p>
 *
 * @author gyg
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/cloud-audio")
@Api(value = "音频模块", tags = "音频模块")
@Slf4j
public class CloudAudioController {

    @Resource
    private CloudAudioService cloudAudioService;

    @GetMapping("/list")
    @ApiOperation(value = "音频列表")
    public RespTable<List<AudioResult>> audioList(FileParam fileParam) {
        RespTable<List<AudioResult>> respTable = cloudAudioService.audioList(fileParam);
        return respTable;
    }

    @PutMapping("/ban")
    @ApiOperation(value = "封禁音频")
    public RespEntity banAudio(@RequestBody BanParam banParam) {
        RespEntity respEntity = cloudAudioService.banAudio(banParam);
        return respEntity;
    }

    @PutMapping("/unseal")
    @ApiOperation(value = "解封音频")
    public RespEntity unsealAudio(@RequestBody BanParam banParam) {
        RespEntity respEntity = cloudAudioService.unsealAudio(banParam);
        return respEntity;
    }

}
